home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 …ember: Reference Library / Apple Developer Reference Library (December 1999) (Disk 1).iso / pc / technical documentation / develop / develop issue 28 / develop issue 28 code / sketch / source / main / assertion.c next >
Encoding:
C/C++ Source or Header  |  1996-08-11  |  753 b   |  33 lines

  1. /****************************************************************************
  2.  * 
  3.  * Assertion.c
  4.  *
  5.  ****************************************************************************/
  6.  
  7. #include "Assertion.h"
  8. #include "StringUtils.h"
  9.  
  10. /*****************************************************************************
  11.  * 
  12.  * DOAssert
  13.  * 
  14.  * If the specified condition is false, generate a call to DebugStr
  15.  *
  16.  * • NOTE: Compiled and called via Assert(...) only if __USEASSERTIONS__ is true
  17.  * 
  18.  *****************************************************************************/
  19.  
  20. #if __USEASSERTIONS__
  21.  
  22. void DoAssert(Boolean condition, char *message)
  23. {
  24.     if (condition == false)
  25.     {
  26.         Str255 debugMsg;
  27.         CToPString(message, debugMsg);
  28.         DebugStr(debugMsg);
  29.     }
  30. }
  31.  
  32. #endif
  33.